Skip to content

refactor: Enable SELECT * optimization when compiling read-table nodes into sqlglot#2430

Open
chelsea-lin wants to merge 3 commits intomainfrom
main_chelsealin_selectstart
Open

refactor: Enable SELECT * optimization when compiling read-table nodes into sqlglot#2430
chelsea-lin wants to merge 3 commits intomainfrom
main_chelsealin_selectstart

Conversation

@chelsea-lin
Copy link
Contributor

Fixes internal issue 481740136 🦕

@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. labels Feb 4, 2026
@chelsea-lin chelsea-lin force-pushed the main_chelsealin_selectstart branch from e085050 to f5a2276 Compare February 4, 2026 20:48
@chelsea-lin chelsea-lin marked this pull request as ready for review February 4, 2026 20:50
@chelsea-lin chelsea-lin requested review from a team as code owners February 4, 2026 20:50
Comment on lines +59 to +62
nodes.ScanItem(
identifiers.ColumnId(scan_item.source_id), scan_item.source_id
)
for scan_item in node.scan_list.items
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think what we really want is to order by the underlying physical schema?

@property
def is_star_selection(self) -> bool:
physical_names = tuple(item.name for item in self.source.table.physical_schema)
scan_names = tuple(item.source_id for item in self.scan_list.items)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the scan list item id must equal source_id as well for this to work as intended

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants